
#ifndef __OLEDMGR_H
#define __OLEDMGR_H


#ifdef __cplusplus
extern "C" {
#endif


#include "lvgl.h"
//#include "hal_function.h"
typedef enum
{
    OLED_PAGE_Start,
    OLED_PAGE_HOME,

    OLED_PAGE_MAX,
}OLED_OBJ_PAGE;

typedef enum
{
    UI_BUTTON_NUM_UP,
    UI_BUTTON_NUM_DOWN,
    UI_BUTTON_NUM_ENTER,
    UI_BUTTON_NUM_EXIT,
    UI_BUTTON_NUM_SLEEP,
    UI_BUTTON_NUM_HOME,

    UI_BUTTON_NUM_MAX,
}UI_BUTTON_NUM;


typedef enum
{
    OLED_EX_DATATYPE_BUTTON,
}OLED_OBJ_EX_DATATYPE;


typedef struct 
{
    uint8_t start_finish;
}oledMessage_START;

typedef struct 
{
    uint8_t start_finish;
}oledMessage_HOME;



//==================================================

typedef struct 
{
    uint8_t button;
}oledMessage_MAX_BUTTON;

typedef union
{
    oledMessage_MAX_BUTTON button;
}oledMessage_MAX_Data;


typedef struct
{
    OLED_OBJ_EX_DATATYPE datatype;
    oledMessage_MAX_Data data;
}oledMessage_MAX;

typedef union
{
    oledMessage_START start;
    oledMessage_HOME home;
    oledMessage_MAX max;
}oledMessage_data;


typedef struct 
{
    OLED_OBJ_PAGE source_page;
    oledMessage_data data;
}oledMessage;


typedef struct 
{
    lv_obj_t *root_scr;


}OLED_PubData_Handle;

extern uint32_t showOLED_Process(uint32_t arg);
extern int oledSendMessage(oledMessage *m);

extern int oledMessage_Button(uint8_t button);
extern OLED_PubData_Handle oledPubData;

#ifdef __cplusplus
}
#endif
#endif